package com.vincce.sport.entity;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.vincce.sport.core.utils.ConvertUtil;
/**
 * 活动实体类
 * @author ex-yanjun
 *
 */
public class Activity {
	private Integer id;
	private String name;
	private Integer brandId;
	private String type;
	private String status;
	private Date startTime;
	private Date endTime;
	private String imgPath;
	private String mark;
	private Integer personNum;
	
	private String brandName;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Integer getBrandId() {
		return brandId;
	}
	public void setBrandId(Integer brandId) {
		this.brandId = brandId;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getStartTime() {
		if(startTime == null)
			return null;
		return ConvertUtil.format("yyyy-MM-dd HH:mm:ss", startTime);
	}
	public void setStartTime(Object startTime) throws ParseException  {
		if(startTime != null){
			if(startTime instanceof Date)
	            this.startTime = (Date)startTime;
	        if (startTime instanceof String)
	            this.startTime=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(startTime.toString());
		} else{
			this.startTime = null;
		}
	}
	public String getEndTime() throws ParseException {
		if(endTime == null)
			return null;
		return ConvertUtil.format("yyyy-MM-dd HH:mm:ss", endTime);
	}
	public void setEndTime(Object endTime) throws ParseException {
		if(startTime != null){
			if(endTime instanceof Date)
	            this.endTime = (Date)endTime;
	        if (endTime instanceof String)
	            this.endTime=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(endTime.toString());
		} else{
			this.endTime = null;
		}
	}
	public String getImgPath() {
		return imgPath;
	}
	public void setImgPath(String imgPath) {
		this.imgPath = imgPath;
	}
	public String getMark() {
		return mark;
	}
	public void setMark(String mark) {
		this.mark = mark;
	}
	public Integer getPersonNum() {
		return personNum;
	}
	public void setPersonNum(Integer personNum) {
		this.personNum = personNum;
	}
	public String getBrandName() {
		return brandName;
	}
	public void setBrandName(String brandName) {
		this.brandName = brandName;
	}
	
}
